package com.ju.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ju.demo.entity.Clientele;
import com.ju.demo.entity.Monitor;
import com.ju.demo.mapper.MonitorMapper;
import com.ju.demo.service.MonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MonitorServiceImpl implements MonitorService {

    @Autowired
    private MonitorMapper monitorMapper;

    /**
     * 通过TeamID查询对应班级的班长
     * @param id
     */
    @Override
    public Monitor findMonitorByTeamID(Integer id) {
        QueryWrapper<Monitor> monitorQueryWrapper = new QueryWrapper<>();
        monitorQueryWrapper.eq("team_id",id);
        Monitor monitor = monitorMapper.selectOne(monitorQueryWrapper);
        return monitor;
    }
}
